# 配置基础容器 python-dev-base
FROM python:3.6
MAINTAINER wanglei wanglei@xiaomingtaiji.com

# 更新Debian源
RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak && \
echo "deb http://mirrors.163.com/debian/ jessie main non-free contrib" >/etc/apt/sources.list && \
echo "deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list && \
echo "deb-src http://mirrors.163.com/debian/ jessie main non-free contrib" >>/etc/apt/sources.list && \
echo "deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list

# 安装自定义package
RUN apt-get update -y && apt-get install -y nano git curl mongodb
    # vim

# initDocker 是文件 initDocker/ 是文件夹
ADD ./requirements.txt /db_update/
WORKDIR /db_update/

RUN pip install -r /db_update/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/

CMD "echo" "db_update docker build sucess!"

# docker build -t xmtj/db_update .
# 即删即用
# docker run --rm -it  -v $(pwd):/ray/comicUpdate/ --name comic_update python_update /bin/bash
# 自动重启/后台运行
# docker run -d --restart=always  -v $(pwd):/db_update/ --name db_update xmtj/db_update  /bin/bash -c 'python3 -u comicUpdate.py'
# 查看输出日志
# docker logs -f comic_update

